package cn.larry.demo.propertyeditor;

import java.beans.PropertyEditorSupport;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cn.larry.demo.domain.Zoo;

/**
 * 这种命名方式是为了避免自动加载。因为想使用 ConfigurableBeanFactory 接口的 registerCustomEditor() 方法加载。
 * 详见 cn.larry.config.PropertyEditorConfig 。
 * 
 * @author LarryZeal
 *
 */
public class ZooEditor extends PropertyEditorSupport {
	private static final Logger logger = LoggerFactory.getLogger(ZooEditor.class);

	@Override
	public void setAsText(String text) throws IllegalArgumentException {
		Zoo zoo = new Zoo();
		zoo.setName(text); //
		super.setValue(zoo);
		logger.error("我是cn.larry.demo.domain.EditorOfZoo");
	}
}
